/**
 * Created by Administrator on 2017/2/13.
 */
import { Component } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { FaceditService }  from './facedit.serve'

@Component({
  moduleId: module.id,
  selector: 'my-facedit',
  templateUrl: 'facedit.html',
  providers:[ FaceditService ]
})
export class FactComponent {
  constructor(
      private route: ActivatedRoute,
      private router: Router,
      private FaceditService:FaceditService,
  ){}
  private detailid='';
  private detailinfro='';
  private errorMessage:string;
  ngOnInit(){
    this.route.params
        .subscribe(
            (params:Params)=>{this.detailid= params['id'];}
        );
    let giveid = this.detailid;
    console.log(giveid);
    this.FaceditService.resdet(giveid)
        .subscribe(
            res => {this.detailinfro = res['data'];
              console.log(this.detailinfro)
            },
            error =>this.errorMessage = <any>error
        )
  }
}
